package com.heiye.quiz.biz.domain.mapper;

import com.heiye.quiz.biz.domain.dataobject.QuizDO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface QuizDOMapper {
    int deleteByPrimaryKey(Long id);

    int insert(QuizDO record);

    int insertSelective(QuizDO record);

    QuizDO selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(QuizDO record);

    int updateByPrimaryKey(QuizDO record);

    /**
     * 问题游标分页查询
     *
     * @param cursor
     * @return
     */
    List<Long> findQuizCursorPageList(@Param("cursor") Long cursor, @Param("languageId") Long languageId);

    /**
     * 根据 ID 集合查询问题
     *
     * @param ids
     * @return
     */
    List<QuizDO> findQuizzesByIds(@Param("ids") List<Long> ids);

    /**
     * 查询问题是否存在
     *
     * @param quizId
     * @return
     */
    int selectCountByQuizId(Long quizId);

    /**
     * 查询问题的发布者用户 ID
     *
     * @param noteId
     * @return
     */
    Long selectCreatorIdByQuizId(Long noteId);
}